Unwind Feature of Structured Exception Handling

In Windows 95, services that can perform function unwinding, such as the longjmp 
function and structured exception handling services RaiseException, try/except, 
and try/finally, should be used with caution when unwinding across 16-bit code. 
Because 16-bit code does not support structured exception handling or unwinding, 
this code is bypassed without notification when unwinding occurs. In particular, 
execution errors can occur if unwinding occurs in the context of services that 
perform callbacks, such as the GetMessage and EnumFonts functions. The 
following program fragment illustrates the type of code that may generate 
unexpected errors:

WinMain()
{
    // initialize ...
    try {
        ...
        while (GetMessage()) {
            // process messages ...
        }
        // close app ...
    } except (EXCEPTION_EXECUTE_HANDLER) {
        // handle exception ...
    }
}

Because GetMessage resides in 16-bit code (USER.EXE) and invokes a 32-bit 
callback function, an exception occuring within the callback function will cause an 
unwind to occur to the exception handler in WinMain. GetMessage will not be 
notified of the unwind, and unpredictable results will occur on future calls into 
USER.EXE. Similarly, if setjmp is used inside WinMain and longjmp is used 
within the callback function, an unwind to WinMain will occur with the same 
unpredictable results as in the try/except case.

For more information on structured exception handling, see "Structured Exception 
Handling" in the Win32 Programmers Reference.

